/***********************************************************
* PIN NAME MACROS
************************************************************/
#define DD_MOSI PB5
#define DD_MISO PB6
#define DD_SCK  PB7
#define CS1		PB0
#define CS2		PB1
#define	RESET1	PB2
#define	RESET2	PB3

/***********************************************************
* VARIABLES
************************************************************/
signed char x[2], y[2];
unsigned char data, srom_result;
signed long sum_x[2], sum_y[2];
float acc_x[2], acc_y[2];
float xval, xval2, yval, omega;
float absx, absy, absrot;  //absolute x,y,rot since the sensors began reading motion
unsigned char data_ready;
unsigned char squal[2];

char temp_str[50]; //temporary string for serial communications

/***********************************************************
* FUNCTION PROTOTYPES
************************************************************/
//Init the SPI
void SPI_MasterInit(void);
//Transmit two bytes to the specified sensor
char SPI_MasterTransmit(unsigned char, unsigned char, unsigned char);
//Read the motion registers from the specified sensor			
char Read_Data(unsigned char);
//Send the motion data over the uart
void Send_Data(void);
//Write to the SROM for the specified sensor
char SROM(unsigned char);
//Burst mode for the specified sensor
void Burst_Mode(unsigned char, char, char *);
//Setup the optical sensors
void Init_Opt(void);
//calculate the position based off optical sensor readings
void Calc_Pos(void);
//initialize everything related to mouse sensors
void initializeMouseSensors(void);
//read the surface quality from each sensor
void ReadSurfaceQuality(void);
